const { gql } = require('apollo-server-koa');

const typeDefs = gql`
  type User {
    name: String
    age: Int
    gender: Int
    id: ID!
    createdAt: String
  }

  type Query {
    users: [User]!
  }

  input UserBaseFields {
    name: String
    age: Int
    gender: Int
  }

  type Mutation {
    createUser (user: UserBaseFields!): User
    updateUser (id: ID!, user: UserBaseFields!): User
    deleteUser (id: ID!): Boolean
  }
`;

module.exports = typeDefs;
